package com.company;

import cn.dev33.satoken.SaManager;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;

/**
 * Spring Boot Starter
 *
 * @author Frank Zhang
 */
@SpringBootApplication(scanBasePackages = {"com.company", "com.alibaba.cola"})
@Slf4j
public class Application implements ApplicationRunner {
    @Value("${server.port}")
    private int serverPort;

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
        log.info("启动成功：Sa-Token配置如下：" + SaManager.getConfig());
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info("swagger api address:http://localhost:{}/swagger-ui/index.html#/",serverPort);
    }
}
